<?php
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
require 'mysql_connect.php';
$vPage='login';
require 'jtools.inc';

$vRefID		= strtoupper($_REQUEST["pRefID"]);
$vAgreed	= $_REQUEST["pAgreed"];
$vAction	= jdecrypt($_REQUEST["pAction"]);


//if ($vMsg == 'No RefID') $vMessage = 'Incorrect Ref ID!';
//if ($vMsg == 'No Agree') $vMessage = 'Please confirm you agree to our Terms & Conditions?';

$vQuery="SELECT idREAgent, RefID FROM reagent WHERE UCASE(RefID)='" . $vRefID . "'";
$rsIDs = mysql_query($vQuery) or die("Invalid query 1: " . mysql_error());
if ((mysql_num_rows($rsIDs) == 1) && ($vAction == 'login')) {
	$rsID = mysql_fetch_array($rsIDs, MYSQL_BOTH); 
	setcookie("RealtyAppCookie_RefID",$rsID["RefID"]);
	setcookie("RealtyAppCookie_AgentID",$rsID["idREAgent"]);
	$vRedirect = '<meta http-equiv="refresh" content="0;URL=home.php">';
} elseif ($vAction == 'login') {
	$vMessage='Unkown Ref ID!';
}

if ($vAction == 'logout') setcookie ('RealtyAppCookie_RefID', '', time() - 3600);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <head><title></title>
    	<?=$vRedirect?>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <meta name="abstract" content="" />
        <meta name="robots" content="All">
        <meta name="robots" content="noindex, nofollow">
        <meta name="copyright" content="Copyright " />
        <meta name="author" content="" />
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <meta content="no" http-equiv="imagetoolbar" />
        <link rel="shortcut icon" href="http://www.appmanager.co.uk/admin_us_broker/favicon.ico"/>
        <link href="style.css" rel="stylesheet" type="text/css">
	<link href="css/slider.css" rel="stylesheet" type="text/css">
        <link href="css/style.css" media="all" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" />
	<link rel="Stylesheet" type="text/css" href="css/jPicker-1.1.6.min.css" />

	<script src="js/jquery-1.6.2.min.js"  type="text/javascript"></script> 
	<script src="js/jquery-ui-1.8.16.custom.min.js"  type="text/javascript"></script>
	<script src="js/jquery.jcarousel.pack.js"  type="text/javascript"></script>
	<script src="js/jquery-func.js" type="text/javascript"></script>
		
	<script src="js/jpicker-1.1.6.min.js" type="text/javascript"></script>
	<!--<script src="js/jquery.js" type="text/javascript"></script>-->
	<script src="http://www.appmanager.co.uk/admin_us_broker/js/javascri.js" type="text/javascript"></script>
        <script src="js/jquery.getParams.js" type="text/javascript"></script>
        <script src="js/jquery.bestupper.min.js" type="text/javascript"></script>
        <script src="js/jquery.alphanumeric.js" type="text/javascript"></script>
        <script src="js/jquery.form-defaults.js" type="text/javascript"></script>
        <script src="js/textLimit.min.js" type="text/javascript"></script>
        <script src="js/ipublish.js" type="text/javascript"></script>
	<script src="js/iphone-style-checkboxes.js" type="text/javascript" charset="utf-8"></script>
                    <script src="js/login.js" type="text/javascript"></script>
        	<script type="text/javascript" charset="utf-8" src="js/site.js"></script>
	<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<script type="text/javascript" src="js/ajaxfileupload.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
  </head>
    <body>
        <div class="outside2">

            <div class="header_wrap cc">


                <div class="header_wrap cc">
                    <script>

    $(document).ready(function(){
        $('[rel=tooltip]').bind('mouseover', function(){
            var theMessage = $(this).attr('content');
            $('<div class="tooltip">' + theMessage + '</div>').appendTo('body').fadeIn('fast');

            $(this).bind('mousemove', function(e){
                $('div.tooltip').css({
                    'top': e.pageY - ($('div.tooltip').height())+10,
                    'left': e.pageX +30
                });
            });
        }).bind('mouseout', function(){
            $('div.tooltip').fadeOut('fast', function(){
                $(this).remove();
            });
        });
    });
	
</script>
<div class="lftop">
    <a href="home.php" class="logo">
        <img src="images/logo.png"/>
    </a>
</div>


                </div>
            </div>

            <div class="container_wrap">
                
<div class="topshadow">&nbsp;</div>
<div class="lineshadow">
    <div class="middle cc">
        <div class="content_text">
            <div class="cc"><img src="images/jasdip_logo.png" class="piclg">
                <div class="introtext">
                    <ul class="listlogos cc">
                    </ul>
                    <br>
                    <h1 class="say-hello"><cufon class="cufon cufon-canvas" alt="Come " style="width: 54px; height: 20px;"><canvas width="68" height="20" style="width: 68px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>Come </cufontext></cufon><cufon class="cufon cufon-canvas" alt="on, " style="width: 31px; height: 20px;"><canvas width="45" height="20" style="width: 45px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>on, </cufontext></cufon><cufon class="cufon cufon-canvas" alt="say " style="width: 32px; height: 20px;"><canvas width="46" height="20" style="width: 46px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>say </cufontext></cufon><cufon class="cufon cufon-canvas" alt="hello!" style="width: 46px; height: 20px;"><canvas width="60" height="20" style="width: 60px; height: 20px; top: 0px; left: -1px;"></canvas><cufontext>hello!</cufontext></cufon></h1>
                </div>
            </div>
            <div id="step1" class="bgcontent moresp cc">
                <div class="signin_container">
                    <div class="cc" id="site_login_box">
                        <h4>Login in to your APP manager	</h4>
                        <form method="POST" action="login.php" target="" class="form_simple" id="login_form">
                            <input type="hidden" name="pAction" value="<?=jencrypt('login')?>">

                            <label for="ref_id_login">Ref ID</label>
                            <input type="text" id="ref_id_login" name="pRefID" maxlength="255" value="<?=$_REQUEST["pRefID"]?>"/>
                            <br>
                            <div class="rememberme">
                                <input type="checkbox" name="pAgreed" id="id_agree" />
                                <label id="remember_me_label" for="id_agree">I agree to <a class="addpopup" href="term.php">terms</a> and <a class="addpopup" href="privacy.php">privacy policy</a>.</label>
				<p class="error_wrapper" id="_err"></p>
				<p class="error_wrapper"><?=$vMessage?></p>
                            </div>
                            <input type="hidden" name="action_type" value="login" id="id_action_type">
                            
                            <a id="forgot_password_link" href="javascript:void(0)" data-category="registration" data-name="login_forgot_password">&nbsp;</a>
			    
                        </form>
                    </div>
                </div>
                <div id="site_register_box">
                    <div class="signup_button_box">
                        <a href="http://www.realtorsmartapps.com/pricing.php" id="starthere">&nbsp;</a>
                    </div>

                    <h2>Don't Have an Account?</h2>
                    <br>
                    <p>To use our interactive app management software you need to start here, tell us what platform  you want and what you want your app to do and leave the rest to us!
                    </p>

                </div>

            </div>
        </div>
    </div>
</div>
            </div>	

            <div class="footer_wrap2 cc">
                <div class="bgfooter cc">
                    
                </div>

            </div>

        </div>

        <script type="text/javascript">
            
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19667077-4']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
            
        </script>	

    </body>
</html>